import uniRequest from "../util/uniRequest.js";
// let baseUrl = "http://192.168.0.176:8080/jeecg-boot";//正式地址
let baseUrl = "http://47.100.190.24/manage";//测试地址


// 手机号登录接口
const phoneLogin= (params) => uniRequest(params, 'POST',baseUrl +'/app/phoneLogin',false, true);
// APP-微信登录
const wxLogin= (params) => uniRequest(params, 'POST',baseUrl +'/app/wxLogin',false, true);
// APP获取短信接口
const getSmsCode = (params) => uniRequest(params, 'POST',baseUrl +'/app/smsCode',false, false);
// 根据学校编码查询年级
const schoolInfo = (params) => uniRequest(params, 'GET',baseUrl +'/app/schoolInfo',false, false);
// APP-添加或编辑学生
const operateStu = (params) => uniRequest(params, 'POST',baseUrl +'/app/operateStu',false, true);
//切换选择默认学生
const defaultStu = (params) => uniRequest(params, 'GET',baseUrl +'/app/defaultStu',false, false);
// 删除学生
const delStu = (params) => uniRequest(params, 'POST',baseUrl +'/app/delStu',false, false);
// 根据用户查看学生列表
const listStu = (params) => uniRequest(params, 'GET',baseUrl +'/app/listStu',true, false);
// 预售和零售封面
const listFm = (params) => uniRequest(params, 'GET',baseUrl +'/app/listFm',false, false);
// APP封面
const homepage = (params) => uniRequest(params, 'GET',baseUrl +'/app/homepage',true, false);
// 注册用户-编辑
const uesrEdit = (params) => uniRequest(params, 'PUT',baseUrl +'/shop/regUser/edit',true, true);
// 注册用户-通过id查询
const uesrQueryById = (params) => uniRequest(params, 'GET',baseUrl +'/shop/regUser/queryById',true, false);

//查看地址列表
const addrList = (params) => uniRequest(params, 'GET',baseUrl +'/app/addrs',false, false);
// 添加或编辑地址
const operateAddr = (params) => uniRequest(params, 'POST',baseUrl +'/app/operateAddr',false, true);
// 删除地址
const delAddr = (params) => uniRequest(params, 'POST',baseUrl +'/app/delAddr',false, false);
// 设置默认地址
const setDefault = (params) => uniRequest(params, 'POST',baseUrl +'/app/setDefault',false, false);


// 根据参数查询零售或预售列表
const listSales = (params) => uniRequest(params, 'POST',baseUrl +'/app/listSales',true, true);
// 根据套装ID或者商品ID查询商品详情
const suitsInfo = (params) => uniRequest(params, 'POST',baseUrl +'/app/suitsInfo',false, true);

// 查询购物车详情
const listCar = (params,type) => uniRequest(params, 'POST',baseUrl +'/app/listCar',type, true);
// 添加编辑购物车
const operateCar = (params,type) => uniRequest(params, 'POST',baseUrl +'/app/operateCar',type, true);
//修改购物车数量
const editCar = (params,type) => uniRequest(params, 'POST',baseUrl +'/app/editCar',type, true);
// 清空购物车
const clearCar = (params) => uniRequest(params, 'GET',baseUrl +'/app/clearCar',false, false);
// APP-取消订单
const cancelOrder = (params,type) => uniRequest(params, 'POST',baseUrl +'/app/cancelOrder',type, true);

// 订单-查询地址
const queryDefaultAddr = (params) => uniRequest(params, 'POST',baseUrl +'/app/queryDefaultAddr',false, true);


// 订单-根据地址查询运费
const queryFeright = (params) => uniRequest(params, 'POST',baseUrl +'/app/queryFeright',false, true);
//获取支付信息
const orderPay = (params) => uniRequest(params, 'GET',baseUrl +'/app/pay',false, false);
//获取支付结果
const payStatus = (params) => uniRequest(params, 'GET',baseUrl +'/app/payStatus',true, true);
// 结算下单
const settlement = (params) => uniRequest(params, 'POST',baseUrl +'/app/settlement',false, true);
//获取支付信息
const appPay = (params,url) => uniRequest(params, 'POST',url,false, true);
// 根据支付状态查询订单
const orders = (params,showType) => uniRequest(params, 'POST',baseUrl +'/app/orders',showType, true);
// 根据订单编号查询订单详情
const orderInfo = (params) => uniRequest(params, 'POST',baseUrl +'/app/orderInfo',false, false);
// 根据订单code查询发货批次
const deliveryBatch = (params) => uniRequest(params, 'POST',baseUrl +'/app/deliveryBatch',false, false);
// 根据发货批次编号查询发货批次明细
const deliveryBatchInfos = (params) => uniRequest(params, 'POST',baseUrl +'/app/deliveryBatchInfos',false, false);
// 根据发货批次编号查询物流
const deliveryBatchDelivery = (params) => uniRequest(params, 'POST',baseUrl +'/app/deliveryBatchDelivery',false, false);
// 一键添加
const oneKey = (params) => uniRequest(params, 'POST',baseUrl +'/app/oneKey',false, true);
// 售后-确认收货
const ensureOrder = (params) => uniRequest(params, 'POST',baseUrl +'/app/ensureOrder',false, false);
// 售后-退换货原因类型列表
const sysDict = (params) => uniRequest(params, 'POST',baseUrl +'/app/sysDict',false, false);
// 售后-查询服装供应商地址
const queryAddr = (params) => uniRequest(params, 'POST',baseUrl +'/app/queryAddr',false, false);
// 查看售后申请列表
const listApplys = (params) => uniRequest(params, 'POST',baseUrl +'/app/listApplys',false, false);
// 售后-申请售后
const applyAfterSale = (params) => uniRequest(params, 'POST',baseUrl +'/app/applyAfterSale',false, true);
// 售后-根据售后服务单查看售后申请
const viewApply = (params) => uniRequest(params, 'POST',baseUrl +'/app/viewApply',false, false);
// 售后-撤销售后申请
const cancelApply = (params) => uniRequest(params, 'POST',baseUrl +'/app/cancelApply',false, false);
// 评价
const eva = (params) => uniRequest(params, 'POST',baseUrl +'/app/eva',false, true);
// APP-查看评价
const viewEva = (params) => uniRequest(params, 'POST',baseUrl +'/app/viewEva',false, true);
// 查看系统公告
const viewSysMsg = (params) => uniRequest(params, 'GET',baseUrl +'/app/viewSysMsg',false, false);
//消息已读
const readMsg = (params) => uniRequest(params, 'GET',baseUrl +'/app/readMsg',true, false);
// 初始化聊天
const initIm = (params) => uniRequest(params, 'GET',baseUrl +'/kefu/kfApi/initIm',true, false);
// 分页查询历史聊天记录
const getHistoryImLogsPageList = (params) => uniRequest(params, 'GET',baseUrl +'/kefu/kfApi/getHistoryImLogsPageList',false, false);



module.exports = {
	
	phoneLogin,
	wxLogin,
	getSmsCode,
	schoolInfo,
	operateStu,
	defaultStu,
	delStu,
	oneKey,
	uesrEdit,
	uesrQueryById,
	applyAfterSale,
	eva,
	
	viewEva,
	ensureOrder,
	sysDict,
	queryAddr,
	listApplys,
	viewApply,
	cancelApply,
	listStu,
	addrList,
	delAddr,
	setDefault,
	operateAddr,
	listCar,
	clearCar,
	cancelOrder,
	editCar,
	viewSysMsg,
	readMsg,
	listFm,
	homepage,
	listSales,
	suitsInfo,
	operateCar,
	queryDefaultAddr,
	queryFeright,
	settlement,
	appPay,
	orderPay,
	payStatus,
	orders,
	orderInfo,
	deliveryBatch,
	deliveryBatchInfos,
	deliveryBatchDelivery,
	initIm,
	getHistoryImLogsPageList
	
}